import redis
import logging

class Config:
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@127.0.0.1:3306/information"
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SECRET_KEY = "dfsdfdfdsfdsf"
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379
    SESSION_TYPE = "redis"
    SESSION_USE_SIGNER = True
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    PERMANENT_SESSION_LIFETIME = 86400


class DevelopementConfig(Config):
    DEBUG = True
    LOG_LEVEL = logging.DEBUG


class ProdutionConfig(Config):
    DEBUG = False
    LOG_LEVEL = logging.ERROR

config_map = {
    "develope": DevelopementConfig,
    "prodution": ProdutionConfig
}
